STEP 7: We need to append the coins value into our empty list so we can track which value was picked each time.

  • In LOGIC, click and drop Append indented inside the loop.
  • Change the variable name my_list to coins and the argument in .append() from my_var to value.

We are now done creating the loop. We have created seven coins, randomly chosen their value from coin_values, and appended that value to the list coins.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)